package org.mysocial.services.facade.ui.impl;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import org.mysocial.datamodel.Account;
import org.mysocial.datamodel.Picture;
import org.mysocial.datamodel.Post;
import org.mysocial.datamodel.Text;
import org.mysocial.services.business.PostBusiness;
import org.mysocial.services.dao.AccountDAO;
import org.mysocial.services.facade.ui.TestFacade;

/**
 * Session Bean implementation class TestFacadeImpl
 */
@Stateless
public class TestFacadeImpl implements TestFacade
{
	@EJB
	private PostBusiness postBusiness;

	@EJB
	private AccountDAO accountDAO;

	@Override
	public Account findById(Long id)
	{
		return accountDAO.findById(id);
	}

	@Override
	public Account persist(Account entity)
	{
		return accountDAO.persist(entity);
	}

	@Override
	public void postComment(Account account, String text, Post target)
	{
		postBusiness.replyComment(account, text, target);
	}

	@Override
	public void postPicture(Account account, String text, Picture picture)
	{
		postBusiness.postPicture(account, text, picture);
	}

	@Override
	public Text postText(Account account, String text)
	{
		return postBusiness.postText(account, text);
	}
}
